<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"	
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"	        
    xmlns:p="http://primefaces.org/ui"    
    xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
	<title>EMMY</title>
	<style type="text/css"></style>
	<script type="text/javascript" src="../javascript/script_fonk.js " />
	<link rel="stylesheet" type="text/css" href="../css/global.css" />
	<link rel="stylesheet" type="text/css" href="../css/sablondaki.css" />
	<link rel="stylesheet" type="text/css" href="../theme/stylesheet.css" />
	<link rel="stylesheet" type="text/css" title="Style"
		href="../theme/stylesheet.css" />
</h:head>

<p:layout fullPage="true" stateful="enabled" >

    <p:layoutUnit position="north" size="100" header="Top" resizable="true"  collapsible="true" >
        <h:outputText value="Top unit content." />
        <c:choose>
             <c:when test="${sessionScope.currentKullanici != null}" >
                    <c:set var="userGroup" value="#{sessionScope.currentKullanici.grup}"/>
					<h:outputLabel value="${sessionScope.currentKullanici.kullaniciid}" />
             </c:when>
             <c:otherwise>
        			<c:set var="userGroup" value="null"/>
             </c:otherwise>
        </c:choose>
	
		<h:form styleClass="form" id="ustMenu">
		<div id="masthead">
			<h1>
				<i>EMMY's place</i>
			</h1>
			<div id="mastheadBox">
				
			</div>
		</div>
		<p:megaMenu>
			<p:submenu label="Anasayfa" icon="ui-icon-check">
				<p:column>
					<p:submenu >
						<p:menuitem value="Anasayfa" url="index.faces" />
					</p:submenu>
				</p:column>
			</p:submenu>

			<p:submenu label="Firmalar" icon="ui-icon-document">
				<p:column>
					<p:submenu >
						<p:menuitem value="Firma Listesi" url="firmaDetay.faces" />
					</p:submenu>
				</p:column>
			</p:submenu>

			<p:submenu label="Ürünler" icon="ui-icon-pencil">
				<p:column>
					<p:submenu >
						<p:menuitem value="Ürün Listesi" url="urunAramaListeleme.faces" />
					</p:submenu>
					<c:if test="${userGroup== 1 }">
						<!-- kullanıcı == musteri -->
						<p:submenu label="Ürünlerim">
							<p:menuitem value="Ürünlerim" url="#" />
							<p:menuitem value="Kayıp Çalıntı" url="#" />
						</p:submenu>
					</c:if>
				</p:column>
				<p:column>
					<c:if test="${userGroup == 2 }">	
						<!-- kullanıcı == uretici -->
						<p:submenu>
							<p:menuitem value="Ürünlerim" url="#" />
							<p:menuitem value="Yeni Ürün Ekle" url="#" />
							<p:menuitem value="Ürün Bilgileri GÜncelle" url="#" />
							<p:menuitem value="Ürün Sil" url="#" />
						</p:submenu>
					</c:if>
				
				</p:column>
			</p:submenu>
			 <c:if test="${userGroup == 2 }">
				<!-- kullanıcı == uretici -->
				<p:submenu label="Ürün Hataları" icon="ui-icon-contact">
					<p:column>
						<p:submenu>
							<p:menuitem value="Hata-Çözüm Listele" url="#" />
							<p:menuitem value="Saptanan Hataları listele" url="#" />
						</p:submenu>
					</p:column>
				</p:submenu>
			</c:if>
			 
			<p:submenu label="Yazılımlar" icon="ui-icon-contact">
				<p:column>
					<p:submenu>
						<p:menuitem value="Yazilim Listesi" url="yazilimAramaListeleme.faces" />
					</p:submenu>
					<c:if test="${userGroup == 1 }">
						<!-- kullanıcı == musteri -->
						<p:submenu>
							<p:menuitem value="Ürünlerime ait yazılımlar" url="#" />
						</p:submenu>
					</c:if>
					<c:if test="${userGroup == 2 }">	
						<!-- kullanıcı == uretici -->
						<p:submenu>
							<p:menuitem value="Yazılımlarım" url="yazilimAramaListeleme.faces" />
						</p:submenu>
					</c:if>
				</p:column>
			</p:submenu>
			<p:submenu label="Duyurular" icon="ui-icon-contact">
				<p:column>
					<p:submenu>
						<p:menuitem value="Duyuru Listesi" url="duyuruList.faces" />
					</p:submenu>
				
					<c:if test="${userGroup == 2 }">	
						<!-- kullanıcı == uretici -->
						<p:submenu>
							<p:menuitem value="Duyurularım" url="duyuruList.faces" />
						</p:submenu>
					</c:if>
				</p:column>
			</p:submenu>
			<c:choose>
				<c:when test="${userGroup == '1' }">
					<!-- kullanıcı ==müşteri -->
					<p:submenu label="Profilim" icon="ui-icon-contact">
						<p:column>
							<p:submenu>
								<p:menuitem value="Profil Detay" url="musteriProDetay.faces" />
							</p:submenu>
						</p:column>
					</p:submenu>
				</c:when>
				<c:when test="${userGroup == '2' }">
					<!-- kullanıcı == temsilci -->
					<p:submenu label="Profilim" icon="ui-icon-contact">
						<p:column>
							<p:submenu>
								<p:menuitem value="Profil Detay" url="#" />
							</p:submenu>
						</p:column>
					</p:submenu>
				</c:when>
			</c:choose>
			
			<p:menuitem value="Servis Sağlayıcı" url="iletisim.faces" icon="ui-icon-close" />
		</p:megaMenu>
		</h:form>
		<h:form id="ustbodyarea">
			<ul id="breadCrumbs">
				<!-- "ustbodyarea" -->
				<h:outputText value="Hoşgeldiniz" />			
			</ul>
		</h:form>
    </p:layoutUnit>

    <p:layoutUnit position="south" size="100" header="Bottom" resizable="true"  collapsible="true">
        <h:outputText value="South unit content." />
    </p:layoutUnit>

    <p:layoutUnit position="west" size="200" header="Left" resizable="true"  collapsible="true">
        <h:outputText value="Left unit content." />
    </p:layoutUnit>

    <p:layoutUnit position="east" size="200" header="Right" resizable="true" collapsible="true" effect="drop">
        <h:outputText value="Right unit content." />
    </p:layoutUnit>

    <p:layoutUnit position="center">
        <h:form>
            This fullPage layout consists of five different layoutUnits which are resizable and closable by default.
			<ui:insert name="body" />
        </h:form>
    </p:layoutUnit>

</p:layout>
                        
</html>